import type { BaseColumnMeta, Size } from './type';

export type DefaultColumn =
  | 'table_index'
  | 'table_select_cell'
  | 'table_action_cell';
export type DefaultColumnConfig = {
  [key in DefaultColumn]?: BaseColumnMeta & { width?: number };
};
// table-name
export const STONG_TABLE = 'stong-table';
export const EDITABLE_TABLE = 'editable-table';
export const DISPLAY_TABLE = 'display-table';
export const SELECT_TABLE = 'select-talbe';
export const SELECT_TABLE_MODAL = 'select-table-modal';
export const SELECT_POP_MODAL = 'select-pop-modal';
export const SETTING_MODAL = 'setting-modal';

export const TABLE_INDEX = 'table_index';
export const TABLE_SELECT_CELL = 'table_select_cell';
export const TABLE_ACTION_CELL = 'table_action_cell';

// 选择类型 - 多选/单选
export const CHECKBOX_SELECT_TYPE = 'checkbox';
export const RADIO_SELECT_TYPE = 'radio';

export const defaultRowKey = 'key';
export const defaultColumns = [
  TABLE_INDEX,
  TABLE_SELECT_CELL,
  TABLE_ACTION_CELL,
];
export const disabledResizeColumn = [
  TABLE_INDEX,
  TABLE_SELECT_CELL,
  TABLE_ACTION_CELL,
];
export const defaultColumnConfig: DefaultColumnConfig = {
  [TABLE_INDEX]: {
    width: 60,
    align: 'center',
    // fixed: 'left',
  },
  [TABLE_SELECT_CELL]: {
    width: 60,
    align: 'center',
    // fixed: 'left',
  },
  [TABLE_ACTION_CELL]: {
    align: 'center',
    // fixed: 'right',
  },
};

export const defaultTableSizeConfig: {
  [key in Size]: {
    thead: number;
    tbody: number;
    summary: number;
    pagination: number;
  };
} = {
  large: { thead: 48, tbody: 55, summary: 54, pagination: 46 },
  middle: { thead: 40, tbody: 47, summary: 46, pagination: 46 },
  small: { thead: 34, tbody: 39, summary: 38, pagination: 46 },
};
export const defaultPopModalStyle = {
  width: 800,
  height: 400,
};
export const defaultPagination = { current: 1, pageSize: 10, total: 0 };
